@echo off

if not exist extdec\*.g*        call  wiso\eGraphic.bat


if not exist ..\extracted\tgraphic32 mkdir ..\extracted\tgraphic32
if exist extracted\0225.gnop   ffxgnop -e1      -t4 -n  extracted\0225.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0225_32.bmp
if exist extracted\0226.gnop   ffxgnop -e0      -t4 -n  extracted\0226.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0226_32.bmp

rem 4bits
if exist extracted\0230.gnop   ffxgnop -e13,7   -t4 -n  extracted\0230.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0230_32.bmp
if exist extracted\0229.gnop   ffxgnop -e13,0   -t4 -n  extracted\0229.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0229_32.bmp
if exist extracted\0229.gnop   ffxgnop -e13,11  -t4 -n  extracted\0229.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0229_miss_32.bmp
if exist extracted\0229.gnop   ffxgnop -e13,12  -t4 -n  extracted\0229.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0229_immune_32.bmp
if exist extracted\0229.gnop   ffxgnop -e13,13  -t4 -n  extracted\0229.gnop  extracted\0223.mpal  ..\extracted\tgraphic32\0229_overkill_32.bmp


rem extension may be pressent or missing
rem extracting 34th image from 0240
FOR %%i IN (extdec\0240*) DO ffxgnop -e  -t4 -n  -pb 128,128,8,0x9A1D0  -pp 0x5920    %%i  %%i  ..\extracted\tgraphic32\%%~ni_32.bmp

FOR %%i IN (extdec\2986*) DO (
    ffxgnop  -e -t4 -n -pb 256,128,8,0x25F00  -pp 0x242E0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_0_32.bmp
    ffxgnop  -e -t4 -n -pb 256,128,8,0x2DF00  -pp 0x246E0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_1_32.bmp
    ffxgnop  -e -t4 -n -pb 256,128,8,0x35F00  -pp 0x24AE0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_2_32.bmp
    ffxgnop  -e -t4 -n -pb 256,128,8,0x3DF00  -pp 0x24EE0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_3_32.bmp
    ffxgnop  -e -t4 -n -pb 256,128,8,0x45F00  -pp 0x252E0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_4_32.bmp
    ffxgnop  -e -t4 -n -pb 256,128,8,0x4DF00  -pp 0x256E0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_5_32.bmp
    ffxgnop  -e -t4 -n -pb 256,64,8,0x55F00   -pp 0x25AE0    %%i  %%i  ..\extracted\tgraphic32\%%~ni_6_32.bmp
)


if exist extdec\0175.gp   ffxgnop  -e -t4 -n -pb 512,512,8,0x420   -pp 0x20     extdec\0175.gp  extdec\0175.gp  ..\extracted\tgraphic32\0175_32.bmp
if exist extdec\0181.gp   ffxgnop  -e -t4 -n -pb 512,512,8,0x420   -pp 0x20     extdec\0181.gp  extdec\0181.gp  ..\extracted\tgraphic32\0181_32.bmp
if exist extdec\0178.gp (
    ffxgnop  -e -t4 -n -pb 512,512,8,0x450   -pp 0x50     extdec\0178.gp  extdec\0178.gp  ..\extracted\tgraphic32\0178_0_32.bmp
    ffxgnop  -e -t4 -n -pb 512,512,8,0x40850 -pp 0x40450  extdec\0178.gp  extdec\0178.gp  ..\extracted\tgraphic32\0178_1_32.bmp
    ffxgnop  -e -t4 -n -pb 256,256,8,0x80C50 -pp 0x80850  extdec\0178.gp  extdec\0178.gp  ..\extracted\tgraphic32\0178_2_32.bmp
    ffxgnop  -e -t4 -n -pb 256,256,8,0x91050 -pp 0x90C50  extdec\0178.gp  extdec\0178.gp  ..\extracted\tgraphic32\0178_3_32.bmp
)


rem if exist extdec\3738.map  ffxgnop  -e -pb 512,448,8,0x72D10  -pp 0xAAD50   extdec\3738.map  extdec\3738.map  ..\extracted\tgraphic32\3738.bmp
rem if exist extdec\3740.map  ffxgnop  -e -pb 512,448,8,0x1B0    -pp 0x381F0   extdec\3740.map  extdec\3740.map  ..\extracted\tgraphic32\3740.bmp
if exist extdec\3738.map  ffxmap -e3 -t4 -n extdec\3738.map  ..\extracted\tgraphic32\3738_32.bmp
if exist extdec\3740.map  ffxmap -e0 -t4 -n extdec\3740.map  ..\extracted\tgraphic32\3740_32.bmp



if not exist extdec\*.ev   call  wiso\eEV.bat

rem blitzball/misc graphic (not extracting duplicit)
ffxgnop  -e -t4 -n   -pb 256,128,8,0x4719A0  -pp 0x4799A0,16,16,0,1   extdec\0348.ev  extdec\0348.ev  ..\extracted\tgraphic32\0348_32.bmp
ffxgnop  -e -t4 -n   -pb 256,256,8,0x5A20    -pp 0x15A20,16,16,0,1    extdec\0547.ev  extdec\0547.ev  ..\extracted\tgraphic32\0547_32.bmp
ffxgnop  -e -t4 -n   -pb 256,128,8,0xD5EA0   -pp 0xDDEA0,16,16,0,1    extdec\0739.ev  extdec\0739.ev  ..\extracted\tgraphic32\0739_32.bmp
ffxgnop  -e -t4 -n   -pb 256,128,8,0x107A0   -pp 0x187A0,16,16        extdec\0830.ev  extdec\0830.ev  ..\extracted\tgraphic32\0830_32.bmp

pause
